#include <map>
#include <memory>

#include "BitMask.h"

static uint32_t const MATRIX_GENERAL_MODULE_DISABLE_ALL{0U};
static uint32_t const MATRIX_GENERAL_MODULE_FACETRACK{1U};
static uint32_t const MATRIX_GENERAL_MODULE_FACEATTR{2U};
static uint32_t const MATRIX_GENERAL_MODULE_FACEEMOTION{3U};
static uint32_t const MATRIX_GENERAL_MODULE_DROWSINESS{4U};
static uint32_t const MATRIX_GENERAL_MODULE_DISTRACTION{5U};
static uint32_t const MATRIX_GENERAL_MODULE_GAZEAOI{6U};
static uint32_t const MATRIX_GENERAL_MODULE_ACTION{7U};
static uint32_t const MATRIX_GENERAL_MODULE_DRIVERMISSING{8U};
static uint32_t const MATRIX_GENERAL_MODULE_CAMERAOCCLUSION{9U};
static uint32_t const MATRIX_GENERAL_MODULE_ACTION_SMOKE{10U};
static uint32_t const MATRIX_GENERAL_MODULE_ENABLE_ALL{(1U << 11U) - 1U};

std::string resultMap(int status) {
    switch (status) {
        case 0:
            return "OFF";
        case 1:
            return "ON";
    }
}

int main() {
    std::shared_ptr<BitMask> bitmask;
    bitmask.reset(new BitMask(MATRIX_GENERAL_MODULE_DISABLE_ALL));
    bitmask->printModuleSwitchInfo();

    //打开第10个模块
    bitmask->moduleEnable(MATRIX_GENERAL_MODULE_ACTION);
    bitmask->printModuleSwitchInfo();
    bitmask->moduleEnable(MATRIX_GENERAL_MODULE_ACTION_SMOKE);

    //获取每个模块的开关情况
    for (unsigned int i = 1; i < 11; i++) {
        printf("%d-%s\n", i, resultMap(bitmask->checkSwitchStatus(i)).c_str());
    }

    bitmask->printModuleSwitchInfo();

    return 0;
}